package com.bai.qf2201.controller;

import com.bai.qf2201.po.Car;
import com.bai.qf2201.service.Impl.carServiceImpl;
import com.bai.qf2201.service.carService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class CarController {
    @Autowired
    private carService csi;

    @ResponseBody
    @RequestMapping("/selectAllCar")
    public List<Car> selectAll( int flag,int getid){
        if (flag==1){
            List<Car> all = csi.findAll(getid);
            return all;
        }
        if (flag==2){
            List<Car> all = csi.findAll2(getid);
            return all;
        }
        return null;

    }
}
